<?php
/*
 * @Author       : ZengHao
 * @Date         : 2024-03-19 15:09:00
 * @LastEditors  : ZengHao
 * @LastEditTime : 2024-03-21 14:46:11
 * @FilePath     : \options\options.php
 * @Description  : 
 * Copyright 2024 www.exehub.net, All Rights Reserved. 
 * 2024-03-19 15:09:00
 */
//载入文件
$require_once = array(
    'options/codestar-framework/autoload.php',
    'options/admin-options.php',
);

foreach ($require_once as $require) {
    require_once MSGBOT_PLUGIN_DIR . $require;
}


function _mop($name, $default = false, $subname = '')
{
    //声明静态变量，加速获取
    static $options = null;
    if ($options === null) {
        $options = get_option('msgboot_fix');
    }
    //判断是否为空，否则直接返回默认值
    if (isset($options[$name])&&!empty($options[$name])) {
        if ($subname) {
            return isset($options[$name][$subname]) ? $options[$name][$subname] : $default;
        } else {
            return $options[$name];
        }
    }
}